﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VVA.Website.UI.Helper;
using VVA.Website.UI.Models;

namespace VVA.Website.UI.Service
{
    public class DictionaryService
    {
        #region Declaration

        #endregion

        #region Constructor

        public DictionaryService()
        {

        }

        #endregion

        #region Method

        public static string GetValueByKey(string key, string culture)
        {
            var reader = DataHelper.CreateInstance().ExecuteCollection<Dictionary>("dbo.Proc_Dictionary_SelectByKey", new Dictionary { Culture = culture, DictionaryKey = key });
            var result = string.Empty;

            if (reader.FirstOrDefault() != null)
            {
                result = reader.FirstOrDefault().DictionaryContent;
            }

            return result;
        }

        #endregion
    }
}